home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / c / cc_pp / v020 / configur < prev    next >
Text File  |  1994-10-30  |  18KB  |  402 lines

  1. This document describes the configuration/installation process for CC++
  2. and lists the resource requirements and supported platforms.
  3.  
  4. The CC++ anonymous ftp site is cs.caltech.edu in the /comp/CC++ directory.
  5.  
  6. ABOUT CC++:
  7. -----------
  8.  
  9. CC++ is a parallel programming language that extends the C++ programming
  10. language.  The current CC++ compiler is implemented as a CC++ to C++
  11. source to source transformer together with a runtime library which supports
  12. threads and communication.  The CC++ transformer is written in C++ and the
  13. CC++ runtime library is written in C++ and C.  The current version of
  14. the runtime library is built on communication primitives provided by
  15. PVM.  In order to build CC++ from source, a C++ compiler is needed that
  16. can build the CC++ transformer and the CC++ runtime library.  In addition,
  17. an ANSI C compiler is needed to build parts of the CC++ runtime library.
  18. Finally, a target (backend) C++ compiler is needed which can compile the
  19. output of the CC++ to C++ source to source transformer.  Typically, the
  20. same C++ compiler is used as a target C++ compiler as is used to
  21. build the CC++ transformer and runtime.  Note that prebuilt (precompiled)
  22. versions of the CC++ transformer and runtime library are available.
  23. Read the following sections for more information.
  24.  
  25. RESOURCE REQUIREMENTS:
  26. ----------------------
  27.  
  28. The following requirements are approximate and were generated by
  29. measuring the space used when CC++ was built on a SPARCstation
  30. running SunOS 4.1.2 and using the sunCC C++ compiler.
  31.  
  32. DISK
  33.  
  34. When unpacked, the cc++ source directory requires about 8MB of disk.
  35. If desired, the CC++ source directory may be removed after CC++ is built
  36. and installed.
  37.  
  38. If the cc++ compiler is built using the -O3 (or -O2) option and _not_ using the
  39. -g option (-O2 or -O3 being the usual case for end-user installations), the
  40. installation directory requires about 3.5 MB of disk space.  The build
  41. directory (which may be removed following the 'make install') requires about
  42. 9.5 MB of disk space.
  43.  
  44. If the cc++ compiler is built using the -g (debugging) option, the
  45. installation directory requires about 9.5 MB of disk space.  The build
  46. directory (which may be removed following the 'make install') requires about
  47. 46 MB of disk space (varies depending on which C++ compiler and hardware
  48. platform is used to build cc++).  Note that the -g flag need not be used
  49. unless you plan to debug the CC++ compiler itself (as opposed to debugging
  50. programs written in CC++).
  51.  
  52. RAM
  53.  
  54. The current release of CC++ requires a large amount of RAM and
  55. virtual memory (swap space) in order to be fast enough to be useful (and
  56. to avoid thrashing your machine).  The CC++ RAM requirements should become
  57. more moderate in future releases.  The following are rough estimates only:
  58. CC++ can use 40MB or more of memory when compiling large CC++ programs.  
  59. As a bare minimum, CC++ needs at least 16MB of real RAM.  CC++ will do
  60. much better with 32MB of RAM and better still with 48MB of real RAM.
  61. Swap space should be large enough to make the virtual memory
  62. of the machine be large enough to handle as many simultaneous CC++
  63. users as you expect to have.  We have found 64MB of swap is a good lower
  64. bound.  Many of our machines have 128MB of swap space.  Note that programs
  65. compiled using CC++ will likely have memory requirements similar to those of
  66. equivalent C++ programs using libraries to obtain parallelism.
  67.  
  68. ---------------------
  69. SOFTWARE REQUIREMENTS
  70. ---------------------
  71.  
  72. CC++ Version 0.2 has been successfully built and installed under the
  73. following combinations of host operating system, C++ compiler, and threads
  74. packages.  If unsure what operating system is installed at your site, try
  75. using the 'uname -a' command to find out.
  76.  
  77. operating system:     SunOS 4.1.2
  78. C++ compiler:         sunCC SC2.0.1 (Sun's C++)
  79. thread package:       FSU's pthreads (modified for use with CC++)
  80.  
  81. operating system:     SunOS 4.1.2
  82. C++ compiler:         CenterLine C++ version 2.2
  83. thread package:       FSU's pthreads (modified for use with CC++)
  84.  
  85. operating system:     SunOS 4.1.2
  86. C++ compiler:         USL cfront C++ 3.0.1
  87. thread package:       FSU's pthreads (modified for use with CC++)
  88.    
  89. operating system:     SunOS 4.1.3
  90. C++ compiler:         sunCC SC2.0.1 (Sun's C++)
  91. thread package:       FSU's pthreads (modified for use with CC++)
  92.    
  93. operating system:     Solaris 2.2
  94. C++ compiler:         sunCC SC2.0.1 (Sun's C++)
  95. thread package:       Solaris threads (comes with Solaris 2.2)
  96.  
  97. operating system:     Solaris 2.3
  98. C++ compiler:         sunCC SC2.0.1 (Sun's C++)
  99. thread package:       Solaris threads (comes with Solaris 2.3)
  100.  
  101. operating system:     AIX 3.2
  102. C++ compiler:         xlC (IBM AIX XL C++ Compiler/6000)
  103. thread package:       IBM's DCE threads (available from IBM)
  104.  
  105. As of CC++ version 0.2, the Sun C++ (SunOS 4.1.2 and Solaris 2.2) and
  106. AIX 3.2 combinations are the only ones that have been reasonably well tested.
  107. Note that some older versions of the CenterLine compiler aren't able to build
  108. CC++.  CC++ may also build correctly under Solaris 2.1 but this hasn't been
  109. tested.  CC++ will not yet build correctly under G++ (GNU's C++) because of a
  110. bug in G++'s implementation of virtual functions when used in conjunction with
  111. multiple inheritance.  If and when this G++ bug is fixed, CC++ may become
  112. buildable using G++.
  113.  
  114. PVM
  115.  
  116. The CC++ runtime library targets Nexus which currently uses version 3.2.x of
  117. the PVM library and environment from Oak Ridge National Laboratory (ORNL) as
  118. an underlying interhost communication mechanism.  CC++ requires PVM to be
  119. installed (although it is possible to run CC++ programs without having a pvm
  120. daemon running).  Earlier versions of PVM may also work with CC++.  The CC++
  121. distribution does not contain PVM.  The latest release of PVM should be
  122. available via anonymous ftp in /netlib/pvm3 on netlib.att.com.  PVM
  123. installation instructions are included with the PVM distribution.  The CC++
  124. release notes contain some information on using PVM in conjunction with CC++.
  125.  
  126. The CC++ configuration script needs to be able to find where PVM is
  127. installed on your system.  If pvm is not installed in each user's home
  128. directory (under the name 'pvm3'), then the environment variable
  129. PVM_ROOT needs to be set in each user's .cshrc or .profile.  This
  130. variable should point to the PVM installation directory (e.g.
  131. setenv PVM_ROOT /usr/local/pvm3).
  132.  
  133. BISON
  134.  
  135. In order to build CC++ from scratch, you will need a copy of GNU's bison
  136. (yacc clone).  The CC++ grammar depends on some of the special extra
  137. features available in bison and will not build correctly if yacc is used
  138. instead.  Bison may be obtained via anonymous ftp from prep.ai.mit.edu
  139. in the /pub/gnu directory.  After obtaining bison, follow the bison
  140. build and installation instructions.  Be sure to install bison in
  141. a directory that is in your PATH environment variable.
  142.  
  143. Note: a prebuilt (already compiled) version of cctran is available for
  144. various different platforms.  If a prebuilt version is available for your
  145. platform of choice and if you choose to use it, then bison is not needed.
  146. See the 'PREBUILT CC++' section for more information.
  147.  
  148. ANSI C Compiler
  149.  
  150. The contents of the ./nexus subdirectory need to be built using an ANSI
  151. C Compiler.  CC++ is configured to use 'acc' under SunOS4 and 'cc' otherwise.
  152. The C compiler used to compile Nexus may be changed by setting the
  153. NEXUS_TARGET_CC variable inside the appropriate mh-${host_os} file
  154. (e.g. mh-sunos4) which is in the cc++/config directory.  Run configure
  155. after making any changes to the config files.
  156.  
  157. FSU PTHREADS
  158.  
  159. The SunOS 4.1.2 CC++ uses a slightly modified version of FSU's pthreads package.
  160. This modified version will be made available via ftp from the same location
  161. from which CC++ is available.  To configure and install pthreads (which
  162. should be done _before_ configuring and installing CC++) do the following:
  163.  
  164.    1) obtain pthreads via ftp from the CC++ ftp site.
  165.    2) configure it using the 'configure' script in the pthreads directory
  166.       and the same -prefix= flag that you plan to use to configure CC++.
  167.       An example invocation is as follows:
  168.           configure -prefix=/usr/local/CC++/install
  169.    3) run 'make' and 'make install' from within the pthreads directory.
  170.  
  171. Pthreads must be configured and built from within the pthreads
  172. source directory (the pthreads distribution doesn't yet support multiple
  173. builds from the same source directory).  Also, one of the pthreads
  174. files requires the unbundled SunOS assembler 'as' (we haven't had any success
  175. with using GNU's gas or /usr/bin/as to build it).  For those sites
  176. running SuNOS 4.1.x without the unbundled SunOS compiler package,
  177. we have made a precompiled version of the pthreads library available
  178. in the CC++ ftp site.  See the 'PREBUILT CC++' section for more information.
  179.  
  180. PREPROCESSORS
  181.  
  182. In order to compile and use CC++, you will need a C++ compiler that
  183. uses an ANSI C preprocessor (cpp).  Some C++ compilers (such as AT&T's cfront
  184. under SunOS 4.1.x) may not by default use an ANSI C preprocessor.  If when
  185. configuring CC++, an error message is printed regarding the lack of an ANSI C
  186. preprocessor, you will need to source the following C-shell script (source
  187. scriptname).  This script is only required during the building of CC++.  It
  188. isn't required to run CC++ (in fact, it will likely cause problems if used
  189. in a shell prior to running CC++ in that shell).
  190.  
  191. #---begins---
  192. # Set cppC to point to an ANSI C preprocessor.  This path will likely
  193. # differ for different sites.
  194. setenv cppC /ufs/comp/sun4/lib/gcc-lib/sun4/2.4.5/cpp
  195. #
  196. # Uncomment the following line for older versions of GNU's cpp
  197. #setenv CPPFLAGS -B
  198. #
  199. # Uncomment the following line for newer versions of GNU's cpp 
  200. setenv CPPFLAGS -lang-c++
  201. #----ends----
  202.  
  203. Be sure to only use the above script when using AT&T's cfront
  204. since not doing so will prevent the configure command from succeeding
  205. (e.g. using the above script will cause the configure to fail when
  206. using CenterLine C++).  If using AT&T cfront and you find that cpp
  207. is crashing, try building CC++ from within the CC++ source directory
  208. rather than from a separate build directory (cfront can generate
  209. #line directives that will crash some cpp's).  We have successfully
  210. built CC++ using AT&T cfront together with sunCC's 'cc'.  We have
  211. yet to successfully build CC++ using cfront together with gcc
  212. (undefined symbol __main).
  213.  
  214. -------------
  215. CONFIGURATION
  216. -------------
  217.  
  218. Before CC++ can be built, it must be configured for the particular system
  219. on which it is to be installed.  To accomplish this, use the 'configure'
  220. script in the root directory of the distribution.  This script reads
  221. configuration files stored in the ./config directory.  You will need to
  222. customize a 'site' file (e.g. ms-caltech) to reflect the particulars of the
  223. site at which CC++ is to be installed.
  224.  
  225. EXAMPLE MS-CONFIG SITE FILE
  226.  
  227. #--- begins ---
  228. # ms-caltech: Configuration for optimized CC++ compiler performance
  229. CCC=CC
  230. CC=cc
  231.  
  232. # CCFLAGS for CC (C++)
  233. CCFLAGS_OPTIMIZE=-O3
  234. CCFLAGS_DEBUG=
  235.  
  236. # CFLAGS for cc (C)
  237. CFLAGS_OPTIMIZE=-O3
  238. CFLAGS_DEBUG=
  239. #--- ends ---
  240.  
  241. The CCC variable specifies which C++ compiler to use when building
  242. CC++.  This should be set to the same C++ compiler that is to be used
  243. for the backend C++ compiler (the C++ compiler which compiles the
  244. transformed CC++ produced by the frontend of CC++ (cctran)).  The
  245. reason for this requirement is that the code to be linked by the
  246. backend C++ must link with the CC++ runtime library produced by the
  247. C++ compiler which compiled CC++.  Supposedly the object modules
  248. produced by different compilers should be combinable into one executable
  249. but in practice this sometimes is not the case (e.g. with CenterLine).
  250.  
  251. The CC variable specifies which C compiler to use (many of the files
  252. in the ./cc++/parser directory are C files).
  253.  
  254. The CCFLAGS_OPTIMIZE variable specifies which optimization flags to
  255. use when compiling the CC++ compiler.  Appropriate values for this
  256. variable will vary depending on the host OS and compiler being used.
  257.  
  258. The CCFLAGS_DEBUG variable specifies which debugging flags to use
  259. when compiling the CC++ compiler.  Typical values for this are -g
  260. (for debugging the CC++ compiler with dbx or gdb) or -pg (for profiling
  261. the CC++ compiler).
  262.  
  263. The CFLAGS_OPTIMIZE and CFLAGS_DEBUG variables are for setting the
  264. optimization and debugging flags used when compiling those parts of
  265. the CC++ distribution that are written in C.
  266.  
  267. Here is an example usage of the 'configure' script:
  268.  
  269. configure -prefix=/usr/local/cc++/install -site=caltech \
  270.    -target_CCC=/ufs/comp/CenterLine/bin/CC
  271.  
  272. The prefix flag specifies the directory in which to install CC++.  The site
  273. flag specifies which ms-config file to use from the ./config directory.
  274. E.g. -site=caltech specifies that 'configure' should use ./config/ms-caltech.
  275.  
  276. The target_CCC flag may be used to specify a backend C++ compiler other
  277. than the default.  If target_CCC is not specified then the configure
  278. script will choose a C++ compiler to use based on the platform being
  279. used (e.g. CC on Suns, xlC on RS/6000).
  280.  
  281. The 'configure' script will determine the operating system and architecture
  282. automagically (this information need not be provided via flags to
  283. 'configure').
  284.  
  285. If your system has more than one C++ compiler installed under the same
  286. name but in different directories (e.g. CC is a common name for C++
  287. compilers), then make sure that the C++ compiler specified by
  288. -target_CCC is in fact the one which is invoked when you type
  289. 'CC'.  The order of the directories in your PATH environment variable
  290. may need to be changed to ensure that the correct C++ (CC) is found.
  291. Try using the 'which CC' command to determine which CC will be found
  292. when 'CC' is executed.
  293.  
  294. ------------
  295. INSTALLATION
  296. ------------
  297.  
  298. After configuring CC++, build and install it by typing:
  299.  
  300.   make
  301.  
  302. followed by:
  303.  
  304.   make install
  305.  
  306. The configuration, compiling, and installation may take quite some time
  307. (a couple of hours or more) depending on the speed of the target machine
  308. and disk (and the optimization level chosen for the C++ compiler used to
  309. compile CC++).
  310.  
  311. PREBUILT CC++
  312.  
  313. In case you would like to avoid long compile times or have or want to
  314. get bison and/or ANSI C, we have made available prebuilt (precompiled)
  315. distributions of CC++ for various platforms.  These prebuilt distributions
  316. are available from the CC++ ftp site and will be named sunos4.1.2-pre.tar.Z,
  317. aix3.2-pre.tar.Z, etc.  Note that the prebuilt distributions are supplements
  318. to the standard CC++ distribution and not as a replacement; that is, the
  319. prebuilt distribution requires source files from the standard distribution in
  320. order to build a working cc++ binary.  Installing the prebuilt version of
  321. CC++ typically takes around five minutes on a SPARCstation LX.
  322.  
  323. If using the prebuilt distribution, make sure to unpack cc++, pthreads
  324. (if using SunOS 4.1.2), and the prebuilt distribution into the same
  325. parent directory.  This is necessary so that the 'make prebuilt' process can
  326. find the precompiled binaries and libraries.  One directory structure
  327. that would work is as follows:
  328.  
  329. /usr/local/CC++/cc++
  330. /usr/local/CC++/pthreads
  331. /usr/local/CC++/prebuilt
  332.  
  333. If you choose to use the prebuilt CC++, use the following three configuration
  334. and installation steps.
  335.  
  336. 0) Create the installation directory (e.g. mkdir /usr/local/CC++/install)
  337.    that you plan to specify via the -prefix= option to 'configure'.
  338.  
  339. 1) Configure the pthreads directory (if using SunOS 4.1.2) as described
  340.    in the FSU PTHREADS section.  Inside the pthreads directory, type
  341.    'make prebuilt' and 'make install-prebuilt'
  342.  
  343. 2) Configure the 'cc++' directory as described in the CONFIGURATION
  344.    section (this cc++ directory is created when the standard cc++
  345.    distribution is unpacked).
  346.  
  347. 3) Inside the cc++ directory, type 'make prebuilt' and 'make install-prebuilt'
  348.  
  349. At this point CC++ is installed and ready to use (if all went well).
  350. See the 'RUNNING THE CC++ COMPILER' section.
  351.  
  352. MULTIPLE BUILD DIRECTORIES
  353.  
  354. If building the CC++ compiler for multiple platforms it is convenient
  355. to use the same source tree for all of the builds.  This dramatically
  356. reduces the disk space required for handling multiple builds (assuming
  357. the various hosts share a filesystem via NFS or some other equivalent
  358. mechanism).  To take advantage of this possibility, simply invoke the
  359. 'configure' script from the directory in which you'd like CC++ to be
  360. built (this directory should not be the same directory as used by the
  361. CC++ source).
  362.  
  363. E.g. if the CC++ distribution is stored in $HOME/src/cc++ then you might
  364. want to create a directory $HOME/config/host_os/compiler for each target
  365. host_os/compiler combination (with the words host_os and compiler replaced
  366. with appropriate values).  Then from within the $HOME/config/host_os/compiler
  367. directory, type:
  368.  
  369. $HOME/src/cc++/configure -prefix=the_install_dir -site=the_site_config_file
  370.  
  371. Note that this method will only work if a 'configure' has never been
  372. performed from within the $HOME/src/cc++ directory.
  373.  
  374. FOR MORE INFORMATION
  375.  
  376. For more detailed information on the configure utility, see the GNU
  377. documents "cfg-paper.texi, and configure.*" in the ./cc++/docs directory.
  378.  
  379. -------------------------
  380. RUNNING THE CC++ COMPILER
  381. -------------------------
  382.  
  383. Before using CC++ make sure that the CC++ bin directory is in your
  384. PATH environment variable (the directory that contains the executable
  385. named "cc++") in your .login or .profile file (depending on which shell
  386. you use).  The easiest way to ensure this is to put the cc++ binary
  387. in a standard location such as /usr/local/bin that is already in
  388. everyone's path.
  389.  
  390. See the CC++ man page (type 'man cc++') for more information on the various
  391. command line flags/options available in CC++.  Also read the CC++ tutorial
  392. (cc++-tutorial.ps) and try the example programs (examples.tar.gz) to become
  393. familiar with using CC++.
  394.  
  395. ---------------------
  396. RUNNING CC++ PROGRAMS
  397. ---------------------
  398.  
  399. If using CC++ on a machine running the Solaris 2.x OS, be sure to add
  400. /usr/ucblib to your LD_LIBRARY_PATH environment variable (in $HOME/.cshrc
  401. or $HOME/.profile depending on which shell you use).
  402.